<?php echo $this->Session->flash(); ?>
<?php

$total = 0;
$total_area = 0;
?>

<table width="100%"  >
    <thead style="background:#9097E8">
        <tr>

            <th >Rubro</th>
            <th>Área (ha)</th>
            <th ></th>
        </tr>
       
    </thead>
    <tbody>
        <?php foreach ($lineas as $linea): ?>
            <tr style="background-color: #CCC5DB;height: 30px">

                <td>
                    <?php echo $linea['ProductiveActivity']['nombre'] ?>
                </td>
                <td>
                    <?php
                    echo number_format($linea['FinalProductiveLine']['area'], 2, ',', '.');
                    $total_area+=$linea['FinalProductiveLine']['area']
                    ?>
                </td>
                <td>
                    <?php echo $ajax->link('Editar', array('controller' => 'FinalProductiveLines', 'action' => 'edit', $linea['FinalProductiveLine']['id'], $final_evaluation_id), array('class' => 'actions', 'update' => 'lineas', 'indicator' => 'loading', 'escape' => false)); ?>
                    <?php echo $ajax->link('Eliminar', array('controller' => 'FinalProductiveLines', 'action' => 'delete', $linea['FinalProductiveLine']['id'], $final_evaluation_id), array('class' => 'actions', 'update' => 'lineas', 'indicator' => 'loading', 'escape' => false), '¿Realmente desea eliminar el registro?'); ?>
                </td>


            </tr>

        <?php endforeach; ?>
            <tr style="background-color: #AE92DE"><td>Area total (ha) :</td><td><?php echo number_format($total_area, 2, ',', '.'); ?></td><td></td></tr>
    </tbody>
</table>
<br>
<?php echo $ajax->link('Adicionar', array('controller' => 'FinalProductiveLines', 'action' => 'add', $final_evaluation_id), array('class' => 'actions', 'update' => 'lineas', 'indicator' => 'loading', 'escape' => false)); ?>
              
